package kr.hkit.androidcomplete02.ch01;

import java.util.ArrayList;

import kr.hkit.androidcomplete02.R;
import android.app.Activity;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class ListOnly extends ListActivity {
	ArrayAdapter<CharSequence> arrayAdapter;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		arrayAdapter = ArrayAdapter.createFromResource(
				this,R.array.county,
				android.R.layout.simple_list_item_1);
		setListAdapter(arrayAdapter);
	}
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		String text = "Select Item = " + arrayAdapter.getItem(position);
		Toast.makeText(this, text, Toast.LENGTH_LONG).show();
				
	}
}
